package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dao.FactoryPhotoDAO;
import com.entity.FactoryPhoto;

@Transactional
@Service
public class FactoryPhotoService {
	@Autowired
	private FactoryPhotoDAO factoryPhotoDAO;
	public List<FactoryPhoto> findInPage(int start, int limit){
		return this.factoryPhotoDAO.findAllInPage(start, limit, FactoryPhoto.INSERT_TIME);
	}
	public int findCount(){
		Object result = this.factoryPhotoDAO.findAllCount();
		if(result == null)
			return 0;
		return ((Long) result).intValue();
	}
}
